package order.client;

import com.example.entity.Carrier;
import com.example.entity.Truck;
import org.springframework.stereotype.Component;


@Component   //注意，需要将其注册为Bean，Feign才能自动注入
public class CarrierFallbackClient implements CarrierClient{
    @Override // 根据id获取单价
    public Float getUnitPrice(Long carrierId){
        System.out.println("服务降级");
        return 0F;
    }

    @Override  // 根据id获取货车
    public Truck selectTruckById(Long truckId){
        System.out.println("服务降级");
        return new Truck(null,"假的",0F,"mock");
    }

    @Override  // 根据id更新货车状态
    public void updateTruckById(Truck truck) {
        System.out.println("服务降级");
    }

    @Override // 更新司机状态
    public void updateDriverState(Integer state,Long carrierId,Long driverId){
        System.out.println("服务降级");
    }

}
